package cn.com.bluemoon.daps.common.validation.illegal;

import cn.com.bluemoon.daps.common.toolkit.CheckUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class CheckIllegalChar implements ConstraintValidator<IllegalChar,CharSequence> {


  /*  @Override
    public void initialize(IllegalChar constraintAnnotation) {
        this.illegalChar = constraintAnnotation;

    }*/
    @Override
    public boolean isValid(CharSequence value, ConstraintValidatorContext context) {

        if(value == null){
            return true;
        }
        return CheckUtils.isIllegalChar(value.toString());
    }
}
